﻿using Autofac;
using Autofac.Extras.DynamicProxy;
using System.Reflection;

namespace Cache.Aop.Aop
{
    public class AutofacModuleRegister:Autofac.Module
    {
        protected override void Load(ContainerBuilder builder)
        {
            builder.RegisterType<RedisCacheAop>();
            var assemblyService = Assembly.Load("Cache.Aop");
            builder.RegisterAssemblyTypes(assemblyService)
                .InstancePerDependency()
                .AsImplementedInterfaces()
                .EnableInterfaceInterceptors()
                .InterceptedBy(typeof(RedisCacheAop));
                
        }


    }
}
